                 <!--- Script Réalisé par BOUFTIH FADWA -->
<?php
 include("verifierSession.php");
        //require_once("beans/compteRenduBean.php");
require_once('connectBD.php');
require_once('beans/reclamationBean.php');
require_once('dao/nomadeDao.php'); //  loadAllNomade
require_once('dao/tacheDao.php'); // loadAllTache
require_once('configuration.php');
 require_once('_config.inc.php');
 require_once('dao/reclamationDao.php');

 extract($_POST);
 
 $datnow=date('d/m/Y');

 $tacheDao= new tacheDao();
 $allTache=$tacheDao->loadAllTache();

 $nomadeDao= new nomadeDao();
 $allNomade=$nomadeDao->loadAllNomade();

if(isset($envoyer)){



//traitement de la fonction insertReclamation du fichier reclamationDao

 if(isset($daterec) and isset($designation)and isset($description) ){

 	$reclamation= new reclamationBean();
 	$reclamation->setDescription($description);
 	$reclamation->setDesignation($designation);
 	$reclamation->setDateReclamation($daterec);
 	$idNomade=$nomadeDao->loadNomadeByLogin($login)->getIdNomade();
 	$reclamation->setIdNomade($idNomade);
 	$recDao=new reclamationDao();
 	$recDao->insertReclamation($reclamation);
      header("location:reclamation.php");
 }
 
 	
 }
if(!isset($envoyer)){
 $title="Reclamation";
 $tpl->assign('title',$title);
 $tpl->assign('d',$datnow);
 $tpl->assign('tabtache',$allTache); 
 $tpl->assign('tabnomade',$allNomade);
 $tpl->display('reclamation.html');
}







 ?>